<?php $navleft = array(
	'items'=>array(
		array(
			'label'=>'Modules',
			'url'=>'#',
			'itemOptions'=>array('class'=>''),
			'linkOptions'=>array('class'=>'clickfalse'),

			'items'=>array(
				array(
					'label'=>'Core',
					'url'=>array('/site/index'),
				),array(
					'label'=>'References',
					'url'=>array('/reference/default/index'),
				),array(
					'label'=>'Presenter',
					'url'=>array('/presenter/default/index'),
				)
			),
		),array(
			'itemOptions'=>array('class'=>'sprt'),
			'template'=>'',
		),array(
			'label'=>'Main',
			'url'=>'#',
			'itemOptions'=>array('class'=>''),
			'linkOptions'=>array('class'=>'clickfalse'),

			'items'=>array(
				array(
					'label'=>'Search',
					'url'=>array('/reference/default/search'),
				),
				array(
					'label'=>'Borrow',
					'url'=>array('/reference/default/create'),
				),
				array(
					'label'=>'History',
					'url'=>array('/reference/default/history'),
				)
			),
		),
		array(
			'itemOptions'=>array('class'=>'sprt'),
			'template'=>'',
		),
		array(
			'label'=>'Admin',
			'url'=>'#',
			'itemOptions'=>array('class'=>''),
			'linkOptions'=>array('class'=>'clickfalse'),
			'items'=>array(
				array(
					'label'=>'Create New',
					'url'=>array('/reference/admin/create'),
				),
				array(
					'label'=>'Search',
					'url'=>array('/reference/admin/search'),
				)
			),
		),
		array(
			'itemOptions'=>array('class'=>'sprt'),
			'template'=>'',
		),
//			array('label'=>'Home', 'url'=>array('/site/index')),
//			array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
//			array('label'=>'Contact', 'url'=>array('/site/contact')),
//			array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
//			array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
	),
);

$navtop = array(
	'items'=>array(
		array(
			'label'=>Yii::app()->user->name,
			'itemOptions'=>array('class'=>'','style'=>'border:1px solid #CCC;padding:6px 10px;margin:-10px 10px;background-color:#111;color:#DDD;'),
			'linkOptions'=>array('class'=>'','style'=>'font-size:12pt;color:#FFF;font-weight:normal;'),
			'template'=>'Welcome : <span>{menu}</span>'
		),
		array(
			'label'=>'Dashboard',
			'url'=>array('/'),
			'itemOptions'=>array('class'=>''),
			'linkOptions'=>array('class'=>''),
		),
		array(
			'itemOptions'=>array('class'=>'sprt'),
			'template'=>' ',
		),
		array(
			'label'=>'My Account',
			'url'=>array('/site/account'),
			'itemOptions'=>array('class'=>''),
			'linkOptions'=>array('class'=>''),
		),
		array(
			'itemOptions'=>array('class'=>'sprt'),
			'template'=>' ',
		),
		array(
			'label'=>'Logout',
			'itemOptions'=>array('class'=>''),
			'linkOptions'=>array('class'=>''),
			'url'=>array('/logout'),
		),
	),
);

?>
<!DOCTYPE html>
<html lang="en-GB">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<meta name="language" content="en" />
	<base href="<?php echo '//'.Yii::app()->request->getServerName().Yii::app()->request->baseUrl; ?>/" >
	<title><?php echo $this->pageTitle ?></title>
	<link rel="stylesheet" href="css/colorbox.css" type="text/css" media="screen" charset="utf-8">
	<link rel="stylesheet" href="css/default.css" type="text/css" media="screen" charset="utf-8">
	<link rel="stylesheet" href="css/jquery-ui-1.8.9.custom.css" type="text/css" media="screen" title="jqueryui" charset="utf-8">
	<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
	<script src="js/jquery.colorbox-min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/jquery-ui-1.8.9.custom.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/zz.tools.js" type="text/javascript" charset="utf-8"></script>
	
</head>
<body>
<!-- Loading Wrapper -->
<div id='loadingWrapper'></div>

<!-- LEFT Wrapper -->
<div id='wrap-left'>
	<?php
		$label = '<img src="css/images/logo.png" border="0" alt="" />';
		$rurl= array('/');
		$htmlOption = array('id'=>'logo','style'=>'margin-left:-15px;');
		echo CHtml::link($label,$rurl,$htmlOption);
	?>
	<div class='clear' style='height:22px;'></div>
	<div id="wrap-navi">
		<?php $this->widget('zii.widgets.CMenu',$navleft); ?>
	</div>
	<div class='clear'></div>
	<?php if(isset($this->breadcrumbs)):?>
		<?php //$this->widget('zii.widgets.CBreadcrumbs', array('links'=>$this->breadcrumbs,)); ?><!-- breadcrumbs -->
	<?php endif?>
	<div class='clear'></div>
</div>




<div id="wrap-right">
	<nav id='top-nav'>
		<?php $this->widget('zii.widgets.CMenu',$navtop); ?>
	</nav>
	<div class='clear'></div>
	<?php //echo $this->Session->flash(); ?>
	<h2 style='margin:-11px 0 15px 0;'> <?php echo CHtml::encode($this->pageTitle); ?></h2>
	<div style='' class='clicktohide'>
		<?php foreach(Yii::app()->user->getFlashes() as $key => $message) {
		    if ($key=='counters') {continue;} //no need next line since 1.1.7
		    echo "<div class='flash-{$key}'>{$message}</div>";
		} ?>
	</div>

	<?php echo $content ?>
	<div class='clear'></div>
	<div id="footer">&copy; Copyright <?php echo date('Y') ?> <?php echo Yii::app()->params['organization_name'] ?>. All Rights Reserved</div>
</div>

<script type="text/javascript" charset="utf-8">
$(function(){
	$('div#wrap-navi ul > li > a').click(function(e){
		var target = $( this ).parent('li');
		if (target.hasClass('collapse')) {
			target.children('ul').slideDown('fast');
			target.removeClass('collapse');
		} else {
			target.children('ul').slideUp('fast');
			target.addClass('collapse');
		}
	});
	$('a.clickfalse').click(function(e){
		return false;
	});
	$('li.active').parent().parent('li').addClass('active');
});
</script>
</body>
</html>